<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
    <meta charset="UTF-8">
    <title>Spring Boot Contacts</title>
    <!-- 加载样式表 -->
    <link rel="stylesheet" th:href="@{/style.css}">
</head>
<body>
    <h2>Spring Boot Contacts</h2>

    <form method="post">
        <label for="firstName">First Name:</label>
        <input type="text" name="firstName" /><br/>

        <label for="lastName">Last Name:</label>
        <input type="text" name="lastName"> <br>

        <label for="phoneNumber">phoneNumber:</label>
        <input type="text" name="phoneNumber"> <br>

        <label for="emailAddress">emailAddress:</label>
        <input type="text" name="emailAddress"> <br>

        <input type="submit" />
    </form>

    <!-- 渲染联系人列表 -->
    <ul th:each="contact : ${contacts}">
        <li>
            <span th:text="${contact.firstName}">First</span>
            <span th:text="${contact.lastName}">Last</span>
            <span th:text="${contact.phoneNumber}">phoneNumber</span>
            <span th:text="${contact.emailAddress}">emailAddress</span>
        </li>
    </ul>
</body>
</html>